use super::crypt_types::CRYPT_EAL_LibCtx;
use super::crypt_eal_pkey::CRYPT_EAL_PkeyCtx;
pub const CRYPT_HPKE_MODE_BASE: CRYPT_HPKE_Mode = 0;
pub const CRYPT_HPKE_MODE_PSK: CRYPT_HPKE_Mode = 1;
pub const CRYPT_HPKE_MODE_AUTH: CRYPT_HPKE_Mode = 2;
pub const CRYPT_HPKE_MODE_AUTH_PSK: CRYPT_HPKE_Mode = 3;
pub type CRYPT_HPKE_Mode = ::std::os::raw::c_uint;
pub const CRYPT_KEM_DHKEM_P256_HKDF_SHA256: CRYPT_HPKE_KEM_AlgId = 16;
pub const CRYPT_KEM_DHKEM_P384_HKDF_SHA384: CRYPT_HPKE_KEM_AlgId = 17;
pub const CRYPT_KEM_DHKEM_P521_HKDF_SHA512: CRYPT_HPKE_KEM_AlgId = 18;
pub const CRYPT_KEM_DHKEM_X25519_HKDF_SHA256: CRYPT_HPKE_KEM_AlgId = 32;
pub type CRYPT_HPKE_KEM_AlgId = ::std::os::raw::c_uint;
pub const CRYPT_KDF_HKDF_SHA256: CRYPT_HPKE_KDF_AlgId = 1;
pub const CRYPT_KDF_HKDF_SHA384: CRYPT_HPKE_KDF_AlgId = 2;
pub const CRYPT_KDF_HKDF_SHA512: CRYPT_HPKE_KDF_AlgId = 3;
pub type CRYPT_HPKE_KDF_AlgId = ::std::os::raw::c_uint;
pub const CRYPT_AEAD_AES_128_GCM: CRYPT_HPKE_AEAD_AlgId = 1;
pub const CRYPT_AEAD_AES_256_GCM: CRYPT_HPKE_AEAD_AlgId = 2;
pub const CRYPT_AEAD_CHACHA20_POLY1305: CRYPT_HPKE_AEAD_AlgId = 3;
pub const CRYPT_AEAD_EXPORT_ONLY: CRYPT_HPKE_AEAD_AlgId = 65535;
pub type CRYPT_HPKE_AEAD_AlgId = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CRYPT_HPKE_CipherSuite {
    pub kemId: CRYPT_HPKE_KEM_AlgId,
    pub kdfId: CRYPT_HPKE_KDF_AlgId,
    pub aeadId: CRYPT_HPKE_AEAD_AlgId,
}
pub const CRYPT_HPKE_SENDER: CRYPT_HPKE_Role = 0;
pub const CRYPT_HPKE_RECIPIENT: CRYPT_HPKE_Role = 1;
pub type CRYPT_HPKE_Role = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CRYPT_EAL_HpkeCtx {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeGenerateKeyPair(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        cipherSuite: CRYPT_HPKE_CipherSuite,
        ikm: *mut u8,
        ikmLen: u32,
        pkey: *mut *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeNewCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        role: CRYPT_HPKE_Role,
        mode: CRYPT_HPKE_Mode,
        cipherSuite: CRYPT_HPKE_CipherSuite,
    ) -> *mut CRYPT_EAL_HpkeCtx;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeGetEncapKeyLen(
        cipherSuite: CRYPT_HPKE_CipherSuite,
        encapKeyLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetupSender(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        pkey: *mut CRYPT_EAL_PkeyCtx,
        info: *mut u8,
        infoLen: u32,
        pkR: *mut u8,
        pkRLen: u32,
        encapKey: *mut u8,
        encapKeyLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSeal(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        aad: *mut u8,
        aadLen: u32,
        plainText: *const u8,
        plainTextLen: u32,
        cipherText: *mut u8,
        cipherTextLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetupRecipient(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        pkey: *mut CRYPT_EAL_PkeyCtx,
        info: *mut u8,
        infoLen: u32,
        encapKey: *mut u8,
        encapKeyLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeOpen(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        aad: *mut u8,
        aadLen: u32,
        cipherText: *const u8,
        cipherTextLen: u32,
        plainText: *mut u8,
        plainTextLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeExportSecret(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        info: *mut u8,
        infoLen: u32,
        key: *mut u8,
        keyLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetSeq(ctx: *mut CRYPT_EAL_HpkeCtx, seq: u64) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeGetSeq(ctx: *mut CRYPT_EAL_HpkeCtx, seq: *mut u64) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeGetSharedSecret(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        buff: *mut u8,
        buffLen: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetSharedSecret(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        info: *mut u8,
        infoLen: u32,
        buff: *mut u8,
        buffLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeFreeCtx(ctx: *mut CRYPT_EAL_HpkeCtx);
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetPsk(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        psk: *mut u8,
        pskLen: u32,
        pskId: *mut u8,
        pskIdLen: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetAuthPriKey(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        pkey: *mut CRYPT_EAL_PkeyCtx,
    ) -> i32;
}
unsafe extern "C" {
    pub fn CRYPT_EAL_HpkeSetAuthPubKey(
        ctx: *mut CRYPT_EAL_HpkeCtx,
        pub_: *mut u8,
        pubLen: u32,
    ) -> i32;
}